﻿#include "Server.MirForms.VisualMapInfo.VForm.h"
#include "../Server.SMain.h"
#include "Class/VisualizerGlobal.h"
#include "Control/Server.MirForms.VisualMapInfo.Control.RespawnEntry.h"
#include "../../Server/MirDatabase/RespawnInfo.h"
#include "Control/Server.MirForms.VisualMapInfo.Control.MineEntry.h"
#include "../../Server/MirDatabase/MineInfo.h"
#include "Class/ReadMap.h"
#include "../../Server/Settings.h"
#include "../../Server/MirEnvir/Map.h"
#include "../../Server/MirDatabase/MonsterInfo.h"

using namespace Server::MirForms::VisualMapInfo::Class;
using namespace Server::MirForms::VisualMapInfo::Control;
using namespace Microsoft::VisualBasic::PowerPacks;
using namespace Server::MirEnvir;
using namespace Server::MirDatabase;

namespace Server::MirForms::VisualMapInfo
{

    Server::MirEnvir::Envir *VForm::getEnvir() const
    {
        return SMain::getEditEnvir();
    }

    VForm::VForm()
    {
        InitializeComponent();
    }

    void VForm::VForm_Load(std::any sender, EventArgs *e)
    {
        InitializeMap();
        InitializeMineInfo();
        InitializeRespawnInfo();
        VisualizerGlobal::FocusModeActivated->addListener("FocusModeActivated", [&] (std::any sender, System::EventArgs e) {FocusModeActivated(sender, e);});
    }

    void VForm::VForm_FormClosing(std::any sender, FormClosingEventArgs *e)
    {
        VisualizerGlobal::ZoomLevel = 1;
        VisualizerGlobal::MapInfo->Respawns.clear();
        VisualizerGlobal::MapInfo->MineZones.clear();

        for (int i = 0; i < RespawnPanel->Controls->Count; i++)
        {
            try
            {
                RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
                MirDatabase::RespawnInfo *NewRespawnZone = new MirDatabase::RespawnInfo();

                NewRespawnZone->Location = new Point(RespawnControl->X, RespawnControl->Y);
                NewRespawnZone->MonsterIndex = RespawnControl->MonsterIndex;
                NewRespawnZone->Spread = RespawnControl->getRange();
                NewRespawnZone->Count = StringHelper::fromString<unsigned short>(RespawnControl->Count->Text);
                NewRespawnZone->Delay = StringHelper::fromString<unsigned short>(RespawnControl->Delay->Text);
                NewRespawnZone->RoutePath = RespawnControl->RoutePath;
                NewRespawnZone->Direction = RespawnControl->Direction;
                NewRespawnZone->RandomDelay = RespawnControl->RandomDelay;

                VisualizerGlobal::MapInfo->Respawns.push_back(NewRespawnZone);

//C# TO C++ CONVERTER TODO TASK: A 'delete NewRespawnZone' statement was not added since NewRespawnZone was passed to a method or constructor. Handle memory management manually.
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }

        for (int i = 0; i < MiningPanel->Controls->Count; i++)
        {
            try
            {
                MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
                MineZone *NewMineZone = new MineZone();

                NewMineZone->Location = new Point(MineControl->X, MineControl->Y);
                NewMineZone->Mine = MineControl->MineIndex;
                NewMineZone->Size = MineControl->getRange();

                VisualizerGlobal::MapInfo->MineZones.push_back(NewMineZone);

//C# TO C++ CONVERTER TODO TASK: A 'delete NewMineZone' statement was not added since NewMineZone was passed to a method or constructor. Handle memory management manually.
            }
            catch (const std::runtime_error &e2)
            {
                continue;
            }
        }
    }

    void VForm::InitializeMap()
    {
        ReadMap *readMap = new ReadMap();

        readMap->mapFile = VisualizerGlobal::MapInfo->FileName;
        readMap->Load();

        MapImage->Image = VisualizerGlobal::ClippingMap;

        Canvas->Parent = MapImage;
        Canvas->BringToFront();

        MapDetailsLabel->Text = StringHelper::formatSimple("Map Name: {0}   Width: {1}   Height: {2}", VisualizerGlobal::MapInfo->Title, VisualizerGlobal::ClippingMap->Width, VisualizerGlobal::ClippingMap->Height);

        delete readMap;
    }

    void VForm::InitializeMineInfo()
    {
        ListItem *tempVar = new ListItem();
        tempVar->Text = "Disabled";
        tempVar->Value = "0";
        MiningFilter->Items->Add(tempVar);

        for (int i = 0; i < Settings::MineSetList.size(); i++)
        {
            ListItem tempVar2(Settings::MineSetList[i]->Name, std::to_string(i + 1));
            MiningFilter->Items->Add(&tempVar2);
        }

        ListItem *tempVar3 = new ListItem();
        tempVar3->Text = "No Filter";
        MiningFilter->Items->Add(tempVar3);
        MiningFilter->Text = "No Filter";

        for (int i = 0; i < VisualizerGlobal::MapInfo->MineZones.size(); i++)
        {
            MineEntry *MineRegion = new MineEntry();
            MineRegion->Dock = DockStyle->Top;
            MineRegion->MineIndex = VisualizerGlobal::MapInfo->MineZones[i]->Mine;
            MineRegion->X = VisualizerGlobal::MapInfo->MineZones[i]->Location->X;
            MineRegion->Y = VisualizerGlobal::MapInfo->MineZones[i]->Location->Y;
            MineRegion->tempRange = VisualizerGlobal::MapInfo->MineZones[i]->Size;
            MineRegion->setRange(VisualizerGlobal::MapInfo->MineZones[i]->Size);
            MineRegion->ShowControl();

            MiningPanel->Controls->Add(MineRegion);

            MineRegion->RegionHighlight->Parent = Canvas;

//C# TO C++ CONVERTER TODO TASK: A 'delete MineRegion' statement was not added since MineRegion was passed to a method or constructor. Handle memory management manually.
        }

//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar3' statement was not added since tempVar3 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar' statement was not added since tempVar was passed to a method or constructor. Handle memory management manually.
    }

    void VForm::InitializeRespawnInfo()
    {
        for (int i = 0; i < getEnvir()->MonsterInfoList.size(); i++)
        {
            RespawnsFilter->Items->Add(getEnvir()->MonsterInfoList[i]);
        }

        ListItem *tempVar = new ListItem();
        tempVar->Text = "No Filter";
        RespawnsFilter->Items->Add(tempVar);
        RespawnsFilter->Text = "No Filter";

        for (int i = 0; i < VisualizerGlobal::MapInfo->Respawns.size(); i++)
        {
            RespawnEntry *RespawnRegion = new RespawnEntry();
            RespawnRegion->Dock = DockStyle->Top;
            RespawnRegion->MonsterIndex = VisualizerGlobal::MapInfo->Respawns[i]->MonsterIndex;
            RespawnRegion->X = VisualizerGlobal::MapInfo->Respawns[i]->Location->X;
            RespawnRegion->Y = VisualizerGlobal::MapInfo->Respawns[i]->Location->Y;
            RespawnRegion->setRange(VisualizerGlobal::MapInfo->Respawns[i]->Spread);
            RespawnRegion->Count->Text = VisualizerGlobal::MapInfo->Respawns[i]std::to_string(->Count);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            RespawnRegion->Delay->Text = VisualizerGlobal::MapInfo->Respawns[i]->Delay.ToString();
            RespawnRegion->RoutePath = VisualizerGlobal::MapInfo->Respawns[i]->RoutePath;
            RespawnRegion->Direction = VisualizerGlobal::MapInfo->Respawns[i]->Direction;
            RespawnRegion->RandomDelay = VisualizerGlobal::MapInfo->Respawns[i]->RandomDelay;
            RespawnRegion->HideControl();

            RespawnPanel->Controls->Add(RespawnRegion);

            RespawnRegion->RegionHighlight->Parent = Canvas;

//C# TO C++ CONVERTER TODO TASK: A 'delete RespawnRegion' statement was not added since RespawnRegion was passed to a method or constructor. Handle memory management manually.
        }

//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar' statement was not added since tempVar was passed to a method or constructor. Handle memory management manually.
    }

    void VForm::RedrawMap()
    {
        Bitmap *Map = new Bitmap(VisualizerGlobal::ClippingMap->Width * VisualizerGlobal::ZoomLevel, VisualizerGlobal::ClippingMap->Height * VisualizerGlobal::ZoomLevel);

//C# TO C++ CONVERTER NOTE: The following 'using' block is replaced by its C++ equivalent:
//ORIGINAL LINE: using (Graphics g = Graphics.FromImage(Map))
        {
            Graphics g = Graphics::FromImage(Map);
            g.InterpolationMode = System::Drawing::Drawing2D::InterpolationMode::NearestNeighbor;
            g.DrawImage(VisualizerGlobal::ClippingMap, 0, 0, Map->Width, Map->Height);
        }

        MapImage->Image = Map;

        if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Mining)
        {
            VisualizerGlobal::FocusMineEntry->UpdateForFocus();
        }
        if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Respawn)
        {
            VisualizerGlobal::FocusRespawnEntry->UpdateForFocus();
        }

//C# TO C++ CONVERTER TODO TASK: A 'delete Map' statement was not added since Map was passed to a method or constructor. Handle memory management manually.
    }

    void VForm::FocusModeActivated(std::any sender, EventArgs *e)
    {
        for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
        {
            try
            {
                MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);

                MineControl->Visible = false;
                MineControl->RegionHighlight->Visible = false;
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }

        for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
        {
            try
            {
                RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);

                RespawnControl->Visible = false;
                RespawnControl->RegionHighlight->Visible = false;
            }
            catch (const std::runtime_error &e2)
            {
                continue;
            }
        }

        if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Mining)
        {
            VisualizerGlobal::FocusMineEntry->Visible = true;
            VisualizerGlobal::FocusMineEntry->RegionHighlight->Visible = true;
            VisualizerGlobal::FocusMineEntry->UpdateForFocus();
        }
        if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Respawn)
        {
            VisualizerGlobal::FocusRespawnEntry->Visible = true;
            VisualizerGlobal::FocusRespawnEntry->RegionHighlight->Visible = true;
            VisualizerGlobal::FocusRespawnEntry->UpdateForFocus();
        }

        EndFocus->Visible = true;
        FocusBreak->Visible = true;

        ToolSelectedChanged(MoveButton, nullptr);
    }

    void VForm::ToolSelectedChanged(std::any sender, EventArgs *e)
    {
        MapImage->Cursor = Cursors::Arrow;

        std::vector<ToolStripButton*> ToolButtons = {SelectButton, AddButton, MoveButton, ResizeButton};

        for (auto Tool : ToolButtons)
        {
            Tool->Checked = false;
        }

        ToolStripButton *ToolSender = std::any_cast<ToolStripButton*>(sender);
        ToolSender->Checked = true;

//C# TO C++ CONVERTER NOTE: The following 'switch' operated on a string and was converted to C++ 'if-else' logic:
//        switch (ToolSender.Text)
//ORIGINAL LINE: case "Select Region":
        if (ToolSender->Text == "Select Region")
        {
                VisualizerGlobal::SelectedTool = VisualizerGlobal::Tool::Select;
                VisualizerGlobal::Cursor = Cursors::Arrow;
        }
//ORIGINAL LINE: case "Add Region":
        else if (ToolSender->Text == "Add Region")
        {
                VisualizerGlobal::SelectedTool = VisualizerGlobal::Tool::Add;
                VisualizerGlobal::Cursor = Cursors::UpArrow;
        }
//ORIGINAL LINE: case "Move Region":
        else if (ToolSender->Text == "Move Region")
        {
                VisualizerGlobal::SelectedTool = VisualizerGlobal::Tool::Move;
                VisualizerGlobal::Cursor = Cursors::SizeAll;
        }
//ORIGINAL LINE: case "Resize Region":
        else if (ToolSender->Text == "Resize Region")
        {
                VisualizerGlobal::SelectedTool = VisualizerGlobal::Tool::Resize;
                VisualizerGlobal::Cursor = Cursors::SizeWE;
        }
        else
        {
        }
    }

    void VForm::EndFocus_Click(std::any sender, EventArgs *e)
    {
        EndFocus->Visible = false;
        FocusBreak->Visible = false;

        MiningFilter->Enabled = true;
        MiningRemoveSelected->Enabled = true;

        RespawnsFilter->Enabled = true;
        RespawnsRemoveSelected->Enabled = true;

        VisualizerGlobal::ZoomLevel = 1;
        RedrawMap();

        if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Mining)
        {
            MiningFilter_SelectedIndexChanged(MiningFilter, nullptr);
        }
        if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Respawn)
        {
            RespawnsFilter_SelectedIndexChanged(RespawnsFilter, nullptr);
        }

        VisualizerGlobal::FocusMineEntry = nullptr;
        VisualizerGlobal::FocusRespawnEntry = nullptr;
        VisualizerGlobal::SelectedFocusType = VisualizerGlobal::FocusType::None;
    }

    void VForm::MapImage_Click(std::any sender, EventArgs *e)
    {
        if (RegionTabs->SelectedTab->Text == "Mining")
        {
            if (VisualizerGlobal::SelectedTool == VisualizerGlobal::Tool::Add)
            {
                MineEntry *MineControl = new MineEntry();
                MineControl->Dock = DockStyle->Top;
                MineControl->X = MouseDownLocation->X;
                MineControl->Y = MouseDownLocation->Y;
                MineControl->setRange(50);

                MineControl->ShowControl();
                MineControl->RegionHighlight->Parent = Canvas;

                MiningPanel->Controls->Add(MineControl);

                ToolSelectedChanged(MoveButton, e);

//C# TO C++ CONVERTER TODO TASK: A 'delete MineControl' statement was not added since MineControl was passed to a method or constructor. Handle memory management manually.
            }
        }

        if (RegionTabs->SelectedTab->Text == "Respawns")
        {
            if (VisualizerGlobal::SelectedTool == VisualizerGlobal::Tool::Add)
            {
                RespawnEntry *RespawnControl = new RespawnEntry();
                RespawnControl->Dock = DockStyle->Top;
                RespawnControl->X = MouseDownLocation->X;
                RespawnControl->Y = MouseDownLocation->Y;
                RespawnControl->setRange(50);

                RespawnControl->ShowControl();
                RespawnControl->RegionHighlight->Parent = Canvas;

                RespawnPanel->Controls->Add(RespawnControl);

                ToolSelectedChanged(MoveButton, e);

//C# TO C++ CONVERTER TODO TASK: A 'delete RespawnControl' statement was not added since RespawnControl was passed to a method or constructor. Handle memory management manually.
            }
        }
    }

    void VForm::RegionTabs_SelectedIndexChanged(std::any sender, EventArgs *e)
    {
        if (RegionTabs->SelectedTab->Text == "Mining")
        {
            for (int i = RespawnPanel->Controls->Count; i > -1; --i)
            {
                try
                {
                    RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
                    RespawnControl->HideControl();
                }
                catch (const std::runtime_error &e1)
                {
                    continue;
                }
            }

            MiningFilter_SelectedIndexChanged(MiningFilter, nullptr);

            //for (int i = MiningPanel.Controls.Count; i > -1; --i)
            //    try
            //    {
            //        MineEntry MineControl = (MineEntry)MiningPanel.Controls[i];
            //        MineControl.ShowControl();
            //    }
            //    catch (Exception) { continue; }
        }
        else if (RegionTabs->SelectedTab->Text == "Respawns")
        {
            for (int i = MiningPanel->Controls->Count; i > -1; --i)
            {
                try
                {
                    MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
                    MineControl->HideControl();
                }
                catch (const std::runtime_error &e2)
                {
                    continue;
                }
            }

            RespawnsFilter_SelectedIndexChanged(RespawnsFilter, nullptr);

            //for (int i = RespawnPanel.Controls.Count; i > -1; --i)
            //    try
            //    {
            //        RespawnEntry RespawnControl = (RespawnEntry)RespawnPanel.Controls[i];
            //        RespawnControl.ShowControl();
            //    }
            //    catch (Exception) { continue; }
        }
    }

    void VForm::MapImage_MouseDown(std::any sender, MouseEventArgs *e)
    {
        if (VisualizerGlobal::SelectedTool == VisualizerGlobal::Tool::Select)
        {
            return;
        }

        MouseDownLocation = e->Location;
    }

    CreateParams *VForm::getCreateParams() const
    {
        CreateParams *cp = System::Windows::Forms::Form::CreateParams;
        cp->ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
        return cp;
    }

    bool VForm::ProcessCmdKey(Message *&msg, Keys *keyData)
    {
        if (keyData == Keys->M)
        {
            EventArgs tempVar();
            ToolSelectedChanged(MoveButton, &tempVar);

            return true;
        }

        if (keyData == Keys->S)
        {
            EventArgs tempVar2();
            ToolSelectedChanged(SelectButton, &tempVar2);

            return true;
        }

        if (keyData == Keys->R)
        {
            EventArgs tempVar3();
            ToolSelectedChanged(ResizeButton, &tempVar3);

            return true;
        }

        if (keyData == Keys->A)
        {
            EventArgs tempVar4();
            ToolSelectedChanged(AddButton, &tempVar4);

            return true;
        }

        if (keyData == Keys->Add && VisualizerGlobal::getFocusModeActive() == true)
        {
            if (VisualizerGlobal::ZoomLevel != 6)
            {
                VisualizerGlobal::ZoomLevel++;
            }

            RedrawMap();

            return true;
        }

        if (keyData == Keys->Subtract && VisualizerGlobal::getFocusModeActive() == true)
        {
            if (VisualizerGlobal::ZoomLevel != 1)
            {
                VisualizerGlobal::ZoomLevel--;
            }

            RedrawMap();

            return true;
        }

        if (keyData == Keys->Left && VisualizerGlobal::getFocusModeActive() == true)
        {
            if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Mining)
            {
                VisualizerGlobal::FocusMineEntry->X--;
                VisualizerGlobal::FocusMineEntry->setRange(VisualizerGlobal::FocusMineEntry->tempRange);
            }
            else if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Respawn)
            {
                VisualizerGlobal::FocusRespawnEntry->X--;
                VisualizerGlobal::FocusRespawnEntry->setRange(VisualizerGlobal::FocusRespawnEntry->tempRange);
            }

            return true;
        }

        if (keyData == Keys->Right && VisualizerGlobal::getFocusModeActive() == true)
        {
            if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Mining)
            {
                VisualizerGlobal::FocusMineEntry->X++;
                VisualizerGlobal::FocusMineEntry->setRange(VisualizerGlobal::FocusMineEntry->tempRange);
            }
            else if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Respawn)
            {
                VisualizerGlobal::FocusRespawnEntry->X++;
                VisualizerGlobal::FocusRespawnEntry->setRange(VisualizerGlobal::FocusRespawnEntry->tempRange);
            }

            return true;
        }

        if (keyData == Keys->Up && VisualizerGlobal::getFocusModeActive() == true)
        {
            if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Mining)
            {
                VisualizerGlobal::FocusMineEntry->Y--;
                VisualizerGlobal::FocusMineEntry->setRange(VisualizerGlobal::FocusMineEntry->tempRange);
            }
            else if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Respawn)
            {
                VisualizerGlobal::FocusRespawnEntry->Y--;
                VisualizerGlobal::FocusRespawnEntry->setRange(VisualizerGlobal::FocusRespawnEntry->tempRange);
            }

            return true;
        }

        if (keyData == Keys->Down && VisualizerGlobal::getFocusModeActive() == true)
        {
            if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Mining)
            {
                VisualizerGlobal::FocusMineEntry->Y++;
                VisualizerGlobal::FocusMineEntry->setRange(VisualizerGlobal::FocusMineEntry->tempRange);
            }
            else if (VisualizerGlobal::SelectedFocusType == VisualizerGlobal::FocusType::Respawn)
            {
                VisualizerGlobal::FocusRespawnEntry->Y++;
                VisualizerGlobal::FocusRespawnEntry->setRange(VisualizerGlobal::FocusRespawnEntry->tempRange);
            }

            return true;
        }

        if (keyData == Keys->Escape && VisualizerGlobal::getFocusModeActive() == true)
        {
            EndFocus_Click(EndFocus, nullptr);

            return true;
        }

        return System::Windows::Forms::Form::ProcessCmdKey(msg, keyData);
    }

    void VForm::MiningSelectAll_Click(std::any sender, EventArgs *e)
    {
        for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
        {
            MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
            MineControl->Selected->Checked = true;
        }
    }

    void VForm::MiningSelectNone_Click(std::any sender, EventArgs *e)
    {
        for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
        {
            MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
            MineControl->Selected->Checked = false;
        }
    }

    void VForm::MiningInvertSelection_Click(std::any sender, EventArgs *e)
    {
        for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
        {
            MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
            MineControl->Selected->Checked = !MineControl->Selected->Checked;
        }
    }

    void VForm::MiningRemoveSelected_Click(std::any sender, EventArgs *e)
    {
        if (MiningPanel->Controls->Count == 0)
        {
            return;
        }

        DialogResult *result = MessageBox::Show("Remove selected records?", "", MessageBoxButtons::YesNoCancel);
        if (result != System::Windows::Forms::DialogResult::Yes)
        {
            return;
        }

        for (int i = MiningPanel->Controls->Count; i > -1; --i)
        {
            try
            {
                MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
                if (MineControl->Selected->Checked == true)
                {
                    MineControl->RemoveEntry();
                }
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }
    }

    void VForm::MiningHideRegion_Click(std::any sender, EventArgs *e)
    {
        for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
        {
            try
            {
                MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
                if (MineControl->Selected->Checked == true)
                {
                    MineControl->HideRegion();
                }
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }
    }

    void VForm::MiningShowRegion_Click(std::any sender, EventArgs *e)
    {
        for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
        {
            try
            {
                MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);
                if (MineControl->Selected->Checked == true)
                {
                    MineControl->ShowRegion();
                }
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }
    }

    void VForm::MiningFocusRegion_Click(std::any sender, EventArgs *e)
    {
        VisualizerGlobal::SelectedTool = VisualizerGlobal::Tool::Focus;
        VisualizerGlobal::Cursor = Cursors::Hand;

        MiningFilter->Enabled = false;
        MiningRemoveSelected->Enabled = false;
    }

    void VForm::MiningFilter_SelectedIndexChanged(std::any sender, EventArgs *e)
    {
        VisualizerGlobal::ZoomLevel = 1;

        if (MiningFilter->Text == "No Filter")
        {
            for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
            {
                try
                {
                    MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);

                    MineControl->Visible = true;
                    if (!MineControl->RegionHidden)
                    {
                        MineControl->RegionHighlight->Visible = true;
                    }
                }
                catch (const std::runtime_error &e1)
                {
                    continue;
                }
            }
        }
        else
        {
            for (int i = MiningPanel->Controls->Count - 1; i > -1; i--)
            {
                try
                {
                    MineEntry *MineControl = static_cast<MineEntry*>(MiningPanel->Controls[i]);

                    if (MineControl->MineIndex == MiningFilter->SelectedIndex)
                    {
                        MineControl->Visible = true;

                        if (!MineControl->RegionHidden)
                        {
                            MineControl->RegionHighlight->Visible = true;
                        }
                    }
                    else
                    {
                        MineControl->RegionHighlight->Visible = false;
                        MineControl->Visible = false;
                    }
                }
                catch (const std::runtime_error &e2)
                {
                    continue;
                }
            }
        }
    }

    void VForm::RespawnsSelectAll_Click(std::any sender, EventArgs *e)
    {
        for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
        {
            RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
            RespawnControl->Selected->Checked = true;
        }
    }

    void VForm::RespawnsSelectNone_Click(std::any sender, EventArgs *e)
    {
        for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
        {
            RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
            RespawnControl->Selected->Checked = false;
        }
    }

    void VForm::RespawnsRemoveSelected_Click(std::any sender, EventArgs *e)
    {
        if (RespawnPanel->Controls->Count == 0)
        {
            return;
        }

        DialogResult *result = MessageBox::Show("Remove selected records?", "", MessageBoxButtons::YesNoCancel);
        if (result != System::Windows::Forms::DialogResult::Yes)
        {
            return;
        }

        for (int i = RespawnPanel->Controls->Count; i > -1; --i)
        {
            try
            {
                RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
                if (RespawnControl->Selected->Checked == true)
                {
                    RespawnControl->RemoveEntry();
                }
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }
    }

    void VForm::ResapwnsHideRegion_Click(std::any sender, EventArgs *e)
    {
        for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
        {
            try
            {
                RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
                if (RespawnControl->Selected->Checked == true)
                {
                    RespawnControl->HideRegion();
                }
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }
    }

    void VForm::ResapwnsShowRegion_Click(std::any sender, EventArgs *e)
    {
        for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
        {
            try
            {
                RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
                if (RespawnControl->Selected->Checked == true)
                {
                    RespawnControl->ShowRegion();
                }
            }
            catch (const std::runtime_error &e1)
            {
                continue;
            }
        }
    }

    void VForm::ResapwnsFocusRegion_Click(std::any sender, EventArgs *e)
    {
        VisualizerGlobal::SelectedTool = VisualizerGlobal::Tool::Focus;
        VisualizerGlobal::Cursor = Cursors::Hand;

        RespawnsFilter->Enabled = false;
        RespawnsRemoveSelected->Enabled = false;
    }

    void VForm::RespawnsInvertSelection_Click(std::any sender, EventArgs *e)
    {
        for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
        {
            RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);
            RespawnControl->Selected->Checked = !RespawnControl->Selected->Checked;
        }
    }

    void VForm::RespawnsFilter_SelectedIndexChanged(std::any sender, EventArgs *e)
    {
        MonsterInfo *info = dynamic_cast<MonsterInfo*>(RespawnsFilter->SelectedItem);

        VisualizerGlobal::ZoomLevel = 1;

        if (RespawnsFilter->Text == "No Filter")
        {
            for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
            {
                try
                {
                    RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);

                    RespawnControl->Visible = true;
                    if (!RespawnControl->RegionHidden)
                    {
                        RespawnControl->RegionHighlight->Visible = true;
                    }
                }
                catch (const std::runtime_error &e1)
                {
                    continue;
                }
            }
        }
        else
        {
            for (int i = RespawnPanel->Controls->Count - 1; i > -1; i--)
            {
                try
                {
                    RespawnEntry *RespawnControl = static_cast<RespawnEntry*>(RespawnPanel->Controls[i]);

                    if (RespawnControl->MonsterIndex == info->Index)
                    {
                        RespawnControl->Visible = true;

                        if (!RespawnControl->RegionHidden)
                        {
                            RespawnControl->RegionHighlight->Visible = true;
                        }
                    }
                    else
                    {
                        RespawnControl->RegionHighlight->Visible = false;
                        RespawnControl->Visible = false;
                    }
                }
                catch (const std::runtime_error &e2)
                {
                    continue;
                }
            }
        }
    }

    void VForm::RegionTabs_Selecting(std::any sender, TabControlCancelEventArgs *e)
    {
        if (VisualizerGlobal::SelectedFocusType != VisualizerGlobal::FocusType::None)
        {
            e->Cancel = true;
        }
    }

    void VForm::Dispose(bool disposing)
    {
        if (disposing && (components != nullptr))
        {
            components->Dispose();
        }
        System::Windows::Forms::Form::Dispose(disposing);
    }

    void VForm::InitializeComponent()
    {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        System::ComponentModel::ComponentResourceManager *resources = new System::ComponentModel::ComponentResourceManager(typeof(VForm));
        this->Tool = new System::Windows::Forms::ToolStrip();
        this->toolStripLabel1 = new System::Windows::Forms::ToolStripLabel();
        this->EndFocus = new System::Windows::Forms::ToolStripButton();
        this->FocusBreak = new System::Windows::Forms::ToolStripSeparator();
        this->SelectButton = new System::Windows::Forms::ToolStripButton();
        this->AddButton = new System::Windows::Forms::ToolStripButton();
        this->MoveButton = new System::Windows::Forms::ToolStripButton();
        this->ResizeButton = new System::Windows::Forms::ToolStripButton();
        this->splitter1 = new System::Windows::Forms::Splitter();
        this->tabPage2 = new System::Windows::Forms::TabPage();
        this->RespawnPanel = new System::Windows::Forms::Panel();
        this->toolStrip3 = new System::Windows::Forms::ToolStrip();
        this->RespawnsRemoveSelected = new System::Windows::Forms::ToolStripButton();
        this->ResapwnsHideRegion = new System::Windows::Forms::ToolStripButton();
        this->ResapwnsShowRegion = new System::Windows::Forms::ToolStripButton();
        this->toolStripSeparator2 = new System::Windows::Forms::ToolStripSeparator();
        this->ResapwnsFocusRegion = new System::Windows::Forms::ToolStripButton();
        this->RespawnsFilter = new System::Windows::Forms::ComboBox();
        this->RespawnTools = new System::Windows::Forms::ToolStrip();
        this->RespawnsSelectAll = new System::Windows::Forms::ToolStripButton();
        this->RespawnsSelectNone = new System::Windows::Forms::ToolStripButton();
        this->RespawnsInvertSelection = new System::Windows::Forms::ToolStripButton();
        this->tabPage4 = new System::Windows::Forms::TabPage();
        this->MiningPanel = new System::Windows::Forms::Panel();
        this->MiningFilter = new System::Windows::Forms::ComboBox();
        this->toolStrip2 = new System::Windows::Forms::ToolStrip();
        this->MiningSelectAll = new System::Windows::Forms::ToolStripButton();
        this->MiningSelectNone = new System::Windows::Forms::ToolStripButton();
        this->MiningInvertSelection = new System::Windows::Forms::ToolStripButton();
        this->toolStrip1 = new System::Windows::Forms::ToolStrip();
        this->MiningRemoveSelected = new System::Windows::Forms::ToolStripButton();
        this->MiningHideRegion = new System::Windows::Forms::ToolStripButton();
        this->MiningShowRegion = new System::Windows::Forms::ToolStripButton();
        this->toolStripSeparator1 = new System::Windows::Forms::ToolStripSeparator();
        this->MiningFocusRegion = new System::Windows::Forms::ToolStripButton();
        this->RegionTabs = new System::Windows::Forms::TabControl();
        this->statusStrip1 = new System::Windows::Forms::StatusStrip();
        this->MapDetailsLabel = new System::Windows::Forms::ToolStripStatusLabel();
        this->mapContainer1 = new Server::MirForms::Control::MapContainer();
        this->MapImage = new System::Windows::Forms::PictureBox();
        this->Tool->SuspendLayout();
        this->tabPage2->SuspendLayout();
        this->toolStrip3->SuspendLayout();
        this->RespawnTools->SuspendLayout();
        this->tabPage4->SuspendLayout();
        this->toolStrip2->SuspendLayout();
        this->toolStrip1->SuspendLayout();
        this->RegionTabs->SuspendLayout();
        this->statusStrip1->SuspendLayout();
        this->mapContainer1->SuspendLayout();
        (static_cast<System::ComponentModel::ISupportInitialize*>(this->MapImage))->BeginInit();
        this->SuspendLayout();
        // 
        // Tool
        // 
        this->Tool->AutoSize = false;
        this->Tool->Dock = System::Windows::Forms::DockStyle::Left;
        this->Tool->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
        this->Tool->ImageScalingSize = new System::Drawing::Size(28, 28);
        this->Tool->Items->AddRange(std::vector<System::Windows::Forms::ToolStripItem*> {this->toolStripLabel1, this->EndFocus, this->FocusBreak, this->SelectButton, this->AddButton, this->MoveButton, this->ResizeButton});
        this->Tool->Location = new System::Drawing::Point(0, 0);
        this->Tool->Name = "Tool";
        this->Tool->Size = new System::Drawing::Size(45, 469);
        this->Tool->TabIndex = 1;
        this->Tool->Text = "toolStrip1";
        // 
        // toolStripLabel1
        // 
        this->toolStripLabel1->Name = "toolStripLabel1";
        this->toolStripLabel1->Size = new System::Drawing::Size(43, 15);
        this->toolStripLabel1->Text = " ";
        // 
        // EndFocus
        // 
        this->EndFocus->AutoSize = false;
        this->EndFocus->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->EndFocus->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("EndFocus.Image")));
        this->EndFocus->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
        this->EndFocus->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->EndFocus->Name = "EndFocus";
        this->EndFocus->Size = new System::Drawing::Size(28, 28);
        this->EndFocus->Text = "End Focus";
        this->EndFocus->Visible = false;
        this->EndFocus->Click += new System::EventHandler(this->EndFocus_Click);
        // 
        // FocusBreak
        // 
        this->FocusBreak->Name = "FocusBreak";
        this->FocusBreak->Size = new System::Drawing::Size(43, 6);
        this->FocusBreak->Visible = false;
        // 
        // SelectButton
        // 
        this->SelectButton->AutoSize = false;
        this->SelectButton->Checked = true;
        this->SelectButton->CheckOnClick = true;
        this->SelectButton->CheckState = System::Windows::Forms::CheckState::Checked;
        this->SelectButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->SelectButton->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("SelectButton.Image")));
        this->SelectButton->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
        this->SelectButton->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
        this->SelectButton->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->SelectButton->Name = "SelectButton";
        this->SelectButton->Size = new System::Drawing::Size(28, 28);
        this->SelectButton->Text = "Select Region";
        this->SelectButton->Click += new System::EventHandler(this->ToolSelectedChanged);
        // 
        // AddButton
        // 
        this->AddButton->AutoSize = false;
        this->AddButton->CheckOnClick = true;
        this->AddButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->AddButton->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("AddButton.Image")));
        this->AddButton->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
        this->AddButton->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
        this->AddButton->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->AddButton->Name = "AddButton";
        this->AddButton->Size = new System::Drawing::Size(28, 28);
        this->AddButton->Text = "Add Region";
        this->AddButton->Click += new System::EventHandler(this->ToolSelectedChanged);
        // 
        // MoveButton
        // 
        this->MoveButton->AutoSize = false;
        this->MoveButton->CheckOnClick = true;
        this->MoveButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MoveButton->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MoveButton.Image")));
        this->MoveButton->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
        this->MoveButton->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MoveButton->Name = "MoveButton";
        this->MoveButton->Size = new System::Drawing::Size(28, 28);
        this->MoveButton->Text = "Move Region";
        this->MoveButton->Click += new System::EventHandler(this->ToolSelectedChanged);
        // 
        // ResizeButton
        // 
        this->ResizeButton->AutoSize = false;
        this->ResizeButton->CheckOnClick = true;
        this->ResizeButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->ResizeButton->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("ResizeButton.Image")));
        this->ResizeButton->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
        this->ResizeButton->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->ResizeButton->Name = "ResizeButton";
        this->ResizeButton->Size = new System::Drawing::Size(28, 28);
        this->ResizeButton->Text = "Resize Region";
        this->ResizeButton->Click += new System::EventHandler(this->ToolSelectedChanged);
        // 
        // splitter1
        // 
        this->splitter1->BackColor = System::Drawing::SystemColors::ActiveCaption;
        this->splitter1->Dock = System::Windows::Forms::DockStyle::Right;
        this->splitter1->Location = new System::Drawing::Point(689, 0);
        this->splitter1->Name = "splitter1";
        this->splitter1->Size = new System::Drawing::Size(5, 469);
        this->splitter1->TabIndex = 3;
        this->splitter1->TabStop = false;
        // 
        // tabPage2
        // 
        this->tabPage2->Controls->Add(this->RespawnPanel);
        this->tabPage2->Controls->Add(this->toolStrip3);
        this->tabPage2->Controls->Add(this->RespawnsFilter);
        this->tabPage2->Controls->Add(this->RespawnTools);
        this->tabPage2->Location = new System::Drawing::Point(4, 22);
        this->tabPage2->Name = "tabPage2";
        this->tabPage2->Size = new System::Drawing::Size(242, 443);
        this->tabPage2->TabIndex = 1;
        this->tabPage2->Text = "Respawns";
        this->tabPage2->UseVisualStyleBackColor = true;
        // 
        // RespawnPanel
        // 
        this->RespawnPanel->AutoScroll = true;
        this->RespawnPanel->Dock = System::Windows::Forms::DockStyle::Fill;
        this->RespawnPanel->Location = new System::Drawing::Point(0, 46);
        this->RespawnPanel->Name = "RespawnPanel";
        this->RespawnPanel->Size = new System::Drawing::Size(242, 372);
        this->RespawnPanel->TabIndex = 3;
        // 
        // toolStrip3
        // 
        this->toolStrip3->Dock = System::Windows::Forms::DockStyle::Bottom;
        this->toolStrip3->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
        this->toolStrip3->Items->AddRange(std::vector<System::Windows::Forms::ToolStripItem*> {this->RespawnsRemoveSelected, this->ResapwnsHideRegion, this->ResapwnsShowRegion, this->toolStripSeparator2, this->ResapwnsFocusRegion});
        this->toolStrip3->Location = new System::Drawing::Point(0, 418);
        this->toolStrip3->Name = "toolStrip3";
        this->toolStrip3->RenderMode = System::Windows::Forms::ToolStripRenderMode::Professional;
        this->toolStrip3->Size = new System::Drawing::Size(242, 25);
        this->toolStrip3->TabIndex = 7;
        this->toolStrip3->Text = "toolStrip3";
        // 
        // RespawnsRemoveSelected
        // 
        this->RespawnsRemoveSelected->Alignment = System::Windows::Forms::ToolStripItemAlignment::Right;
        this->RespawnsRemoveSelected->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->RespawnsRemoveSelected->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("RespawnsRemoveSelected.Image")));
        this->RespawnsRemoveSelected->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->RespawnsRemoveSelected->Name = "RespawnsRemoveSelected";
        this->RespawnsRemoveSelected->Size = new System::Drawing::Size(23, 22);
        this->RespawnsRemoveSelected->Text = "Remove Selected";
        this->RespawnsRemoveSelected->Click += new System::EventHandler(this->RespawnsRemoveSelected_Click);
        // 
        // ResapwnsHideRegion
        // 
        this->ResapwnsHideRegion->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->ResapwnsHideRegion->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("ResapwnsHideRegion.Image")));
        this->ResapwnsHideRegion->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->ResapwnsHideRegion->Name = "ResapwnsHideRegion";
        this->ResapwnsHideRegion->Size = new System::Drawing::Size(23, 22);
        this->ResapwnsHideRegion->Text = "Hide Region";
        this->ResapwnsHideRegion->Click += new System::EventHandler(this->ResapwnsHideRegion_Click);
        // 
        // ResapwnsShowRegion
        // 
        this->ResapwnsShowRegion->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->ResapwnsShowRegion->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("ResapwnsShowRegion.Image")));
        this->ResapwnsShowRegion->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->ResapwnsShowRegion->Name = "ResapwnsShowRegion";
        this->ResapwnsShowRegion->Size = new System::Drawing::Size(23, 22);
        this->ResapwnsShowRegion->Text = "Show Region";
        this->ResapwnsShowRegion->Click += new System::EventHandler(this->ResapwnsShowRegion_Click);
        // 
        // toolStripSeparator2
        // 
        this->toolStripSeparator2->Name = "toolStripSeparator2";
        this->toolStripSeparator2->Size = new System::Drawing::Size(6, 25);
        // 
        // ResapwnsFocusRegion
        // 
        this->ResapwnsFocusRegion->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->ResapwnsFocusRegion->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("ResapwnsFocusRegion.Image")));
        this->ResapwnsFocusRegion->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->ResapwnsFocusRegion->Name = "ResapwnsFocusRegion";
        this->ResapwnsFocusRegion->Size = new System::Drawing::Size(23, 22);
        this->ResapwnsFocusRegion->Text = "Focus Region";
        this->ResapwnsFocusRegion->Click += new System::EventHandler(this->ResapwnsFocusRegion_Click);
        // 
        // RespawnsFilter
        // 
        this->RespawnsFilter->Dock = System::Windows::Forms::DockStyle::Top;
        this->RespawnsFilter->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
        this->RespawnsFilter->FormattingEnabled = true;
        this->RespawnsFilter->Location = new System::Drawing::Point(0, 25);
        this->RespawnsFilter->Name = "RespawnsFilter";
        this->RespawnsFilter->Size = new System::Drawing::Size(242, 21);
        this->RespawnsFilter->TabIndex = 6;
        this->RespawnsFilter->SelectedIndexChanged += new System::EventHandler(this->RespawnsFilter_SelectedIndexChanged);
        // 
        // RespawnTools
        // 
        this->RespawnTools->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
        this->RespawnTools->Items->AddRange(std::vector<System::Windows::Forms::ToolStripItem*> {this->RespawnsSelectAll, this->RespawnsSelectNone, this->RespawnsInvertSelection});
        this->RespawnTools->Location = new System::Drawing::Point(0, 0);
        this->RespawnTools->Name = "RespawnTools";
        this->RespawnTools->RenderMode = System::Windows::Forms::ToolStripRenderMode::Professional;
        this->RespawnTools->Size = new System::Drawing::Size(242, 25);
        this->RespawnTools->TabIndex = 2;
        this->RespawnTools->Text = "toolStrip1";
        // 
        // RespawnsSelectAll
        // 
        this->RespawnsSelectAll->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->RespawnsSelectAll->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("RespawnsSelectAll.Image")));
        this->RespawnsSelectAll->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->RespawnsSelectAll->Name = "RespawnsSelectAll";
        this->RespawnsSelectAll->Size = new System::Drawing::Size(23, 22);
        this->RespawnsSelectAll->Text = "Select All";
        this->RespawnsSelectAll->Click += new System::EventHandler(this->RespawnsSelectAll_Click);
        // 
        // RespawnsSelectNone
        // 
        this->RespawnsSelectNone->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->RespawnsSelectNone->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("RespawnsSelectNone.Image")));
        this->RespawnsSelectNone->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->RespawnsSelectNone->Name = "RespawnsSelectNone";
        this->RespawnsSelectNone->Size = new System::Drawing::Size(23, 22);
        this->RespawnsSelectNone->Text = "Select None";
        this->RespawnsSelectNone->Click += new System::EventHandler(this->RespawnsSelectNone_Click);
        // 
        // RespawnsInvertSelection
        // 
        this->RespawnsInvertSelection->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->RespawnsInvertSelection->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("RespawnsInvertSelection.Image")));
        this->RespawnsInvertSelection->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->RespawnsInvertSelection->Name = "RespawnsInvertSelection";
        this->RespawnsInvertSelection->Size = new System::Drawing::Size(23, 22);
        this->RespawnsInvertSelection->Text = "Invert Selection";
        this->RespawnsInvertSelection->Click += new System::EventHandler(this->RespawnsInvertSelection_Click);
        // 
        // tabPage4
        // 
        this->tabPage4->Controls->Add(this->MiningPanel);
        this->tabPage4->Controls->Add(this->MiningFilter);
        this->tabPage4->Controls->Add(this->toolStrip2);
        this->tabPage4->Controls->Add(this->toolStrip1);
        this->tabPage4->Location = new System::Drawing::Point(4, 22);
        this->tabPage4->Name = "tabPage4";
        this->tabPage4->Size = new System::Drawing::Size(242, 443);
        this->tabPage4->TabIndex = 3;
        this->tabPage4->Text = "Mining";
        this->tabPage4->UseVisualStyleBackColor = true;
        // 
        // MiningPanel
        // 
        this->MiningPanel->AutoScroll = true;
        this->MiningPanel->Dock = System::Windows::Forms::DockStyle::Fill;
        this->MiningPanel->Location = new System::Drawing::Point(0, 46);
        this->MiningPanel->Name = "MiningPanel";
        this->MiningPanel->Size = new System::Drawing::Size(242, 372);
        this->MiningPanel->TabIndex = 3;
        // 
        // MiningFilter
        // 
        this->MiningFilter->Dock = System::Windows::Forms::DockStyle::Top;
        this->MiningFilter->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
        this->MiningFilter->FormattingEnabled = true;
        this->MiningFilter->Location = new System::Drawing::Point(0, 25);
        this->MiningFilter->Name = "MiningFilter";
        this->MiningFilter->Size = new System::Drawing::Size(242, 21);
        this->MiningFilter->TabIndex = 5;
        this->MiningFilter->SelectedIndexChanged += new System::EventHandler(this->MiningFilter_SelectedIndexChanged);
        // 
        // toolStrip2
        // 
        this->toolStrip2->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
        this->toolStrip2->Items->AddRange(std::vector<System::Windows::Forms::ToolStripItem*> {this->MiningSelectAll, this->MiningSelectNone, this->MiningInvertSelection});
        this->toolStrip2->Location = new System::Drawing::Point(0, 0);
        this->toolStrip2->Name = "toolStrip2";
        this->toolStrip2->Size = new System::Drawing::Size(242, 25);
        this->toolStrip2->TabIndex = 2;
        this->toolStrip2->Text = "toolStrip1";
        // 
        // MiningSelectAll
        // 
        this->MiningSelectAll->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MiningSelectAll->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MiningSelectAll.Image")));
        this->MiningSelectAll->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MiningSelectAll->Name = "MiningSelectAll";
        this->MiningSelectAll->Size = new System::Drawing::Size(23, 22);
        this->MiningSelectAll->Text = "Select All";
        this->MiningSelectAll->Click += new System::EventHandler(this->MiningSelectAll_Click);
        // 
        // MiningSelectNone
        // 
        this->MiningSelectNone->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MiningSelectNone->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MiningSelectNone.Image")));
        this->MiningSelectNone->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MiningSelectNone->Name = "MiningSelectNone";
        this->MiningSelectNone->Size = new System::Drawing::Size(23, 22);
        this->MiningSelectNone->Text = "Select None";
        this->MiningSelectNone->Click += new System::EventHandler(this->MiningSelectNone_Click);
        // 
        // MiningInvertSelection
        // 
        this->MiningInvertSelection->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MiningInvertSelection->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MiningInvertSelection.Image")));
        this->MiningInvertSelection->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MiningInvertSelection->Name = "MiningInvertSelection";
        this->MiningInvertSelection->Size = new System::Drawing::Size(23, 22);
        this->MiningInvertSelection->Text = "Invert Selection";
        this->MiningInvertSelection->Click += new System::EventHandler(this->MiningInvertSelection_Click);
        // 
        // toolStrip1
        // 
        this->toolStrip1->Dock = System::Windows::Forms::DockStyle::Bottom;
        this->toolStrip1->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
        this->toolStrip1->Items->AddRange(std::vector<System::Windows::Forms::ToolStripItem*> {this->MiningRemoveSelected, this->MiningHideRegion, this->MiningShowRegion, this->toolStripSeparator1, this->MiningFocusRegion});
        this->toolStrip1->Location = new System::Drawing::Point(0, 418);
        this->toolStrip1->Name = "toolStrip1";
        this->toolStrip1->RenderMode = System::Windows::Forms::ToolStripRenderMode::Professional;
        this->toolStrip1->Size = new System::Drawing::Size(242, 25);
        this->toolStrip1->TabIndex = 4;
        this->toolStrip1->Text = "toolStrip1";
        // 
        // MiningRemoveSelected
        // 
        this->MiningRemoveSelected->Alignment = System::Windows::Forms::ToolStripItemAlignment::Right;
        this->MiningRemoveSelected->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MiningRemoveSelected->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MiningRemoveSelected.Image")));
        this->MiningRemoveSelected->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MiningRemoveSelected->Name = "MiningRemoveSelected";
        this->MiningRemoveSelected->Size = new System::Drawing::Size(23, 22);
        this->MiningRemoveSelected->Text = "Remove Selected";
        this->MiningRemoveSelected->Click += new System::EventHandler(this->MiningRemoveSelected_Click);
        // 
        // MiningHideRegion
        // 
        this->MiningHideRegion->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MiningHideRegion->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MiningHideRegion.Image")));
        this->MiningHideRegion->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MiningHideRegion->Name = "MiningHideRegion";
        this->MiningHideRegion->Size = new System::Drawing::Size(23, 22);
        this->MiningHideRegion->Text = "Hide Region";
        this->MiningHideRegion->Click += new System::EventHandler(this->MiningHideRegion_Click);
        // 
        // MiningShowRegion
        // 
        this->MiningShowRegion->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MiningShowRegion->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MiningShowRegion.Image")));
        this->MiningShowRegion->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MiningShowRegion->Name = "MiningShowRegion";
        this->MiningShowRegion->Size = new System::Drawing::Size(23, 22);
        this->MiningShowRegion->Text = "Show Region";
        this->MiningShowRegion->Click += new System::EventHandler(this->MiningShowRegion_Click);
        // 
        // toolStripSeparator1
        // 
        this->toolStripSeparator1->Name = "toolStripSeparator1";
        this->toolStripSeparator1->Size = new System::Drawing::Size(6, 25);
        // 
        // MiningFocusRegion
        // 
        this->MiningFocusRegion->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
        this->MiningFocusRegion->Image = (std::any_cast<System::Drawing::Image*>(resources->GetObject("MiningFocusRegion.Image")));
        this->MiningFocusRegion->ImageTransparentColor = System::Drawing::Color::Magenta;
        this->MiningFocusRegion->Name = "MiningFocusRegion";
        this->MiningFocusRegion->Size = new System::Drawing::Size(23, 22);
        this->MiningFocusRegion->Text = "Focus Region";
        this->MiningFocusRegion->Click += new System::EventHandler(this->MiningFocusRegion_Click);
        // 
        // RegionTabs
        // 
        this->RegionTabs->Controls->Add(this->tabPage4);
        this->RegionTabs->Controls->Add(this->tabPage2);
        this->RegionTabs->Dock = System::Windows::Forms::DockStyle::Right;
        this->RegionTabs->Location = new System::Drawing::Point(694, 0);
        this->RegionTabs->Multiline = true;
        this->RegionTabs->Name = "RegionTabs";
        this->RegionTabs->SelectedIndex = 0;
        this->RegionTabs->Size = new System::Drawing::Size(250, 469);
        this->RegionTabs->SizeMode = System::Windows::Forms::TabSizeMode::FillToRight;
        this->RegionTabs->TabIndex = 3;
        this->RegionTabs->SelectedIndexChanged += new System::EventHandler(this->RegionTabs_SelectedIndexChanged);
        this->RegionTabs->Selecting += new System::Windows::Forms::TabControlCancelEventHandler(this->RegionTabs_Selecting);
        // 
        // statusStrip1
        // 
        this->statusStrip1->Items->AddRange(std::vector<System::Windows::Forms::ToolStripItem*> {this->MapDetailsLabel});
        this->statusStrip1->Location = new System::Drawing::Point(0, 469);
        this->statusStrip1->Name = "statusStrip1";
        this->statusStrip1->Size = new System::Drawing::Size(944, 24);
        this->statusStrip1->TabIndex = 4;
        this->statusStrip1->Text = "statusStrip1";
        // 
        // MapDetailsLabel
        // 
        this->MapDetailsLabel->BorderSides = System::Windows::Forms::ToolStripStatusLabelBorderSides::Right;
        this->MapDetailsLabel->BorderStyle = System::Windows::Forms::Border3DStyle::Sunken;
        this->MapDetailsLabel->Name = "MapDetailsLabel";
        this->MapDetailsLabel->Size = new System::Drawing::Size(216, 19);
        this->MapDetailsLabel->Text = "Map Name: {0}   Width: {1}   Height: {2}";
        // 
        // mapContainer1
        // 
        this->mapContainer1->AutoScroll = true;
        this->mapContainer1->Controls->Add(this->MapImage);
        this->mapContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
        this->mapContainer1->Location = new System::Drawing::Point(45, 0);
        this->mapContainer1->Name = "mapContainer1";
        this->mapContainer1->Size = new System::Drawing::Size(644, 469);
        this->mapContainer1->TabIndex = 2;
        // 
        // MapImage
        // 
        this->MapImage->Location = new System::Drawing::Point(0, 0);
        this->MapImage->Name = "MapImage";
        this->MapImage->Size = new System::Drawing::Size(0, 0);
        this->MapImage->SizeMode = System::Windows::Forms::PictureBoxSizeMode::AutoSize;
        this->MapImage->TabIndex = 0;
        this->MapImage->TabStop = false;
        this->MapImage->Click += new System::EventHandler(this->MapImage_Click);
        this->MapImage->MouseDown += new System::Windows::Forms::MouseEventHandler(this->MapImage_MouseDown);
        // 
        // VForm
        // 
        this->AutoScaleDimensions = new System::Drawing::SizeF(6.0F, 13.0F);
        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
        this->ClientSize = new System::Drawing::Size(944, 493);
        this->Controls->Add(this->mapContainer1);
        this->Controls->Add(this->splitter1);
        this->Controls->Add(this->RegionTabs);
        this->Controls->Add(this->Tool);
        this->Controls->Add(this->statusStrip1);
        this->DoubleBuffered = true;
        this->Name = "VForm";
        this->Text = "Visualizer";
        this->FormClosing += new System::Windows::Forms::FormClosingEventHandler(this->VForm_FormClosing);
        this->Load += new System::EventHandler(this->VForm_Load);
        this->Tool->ResumeLayout(false);
        this->Tool->PerformLayout();
        this->tabPage2->ResumeLayout(false);
        this->tabPage2->PerformLayout();
        this->toolStrip3->ResumeLayout(false);
        this->toolStrip3->PerformLayout();
        this->RespawnTools->ResumeLayout(false);
        this->RespawnTools->PerformLayout();
        this->tabPage4->ResumeLayout(false);
        this->tabPage4->PerformLayout();
        this->toolStrip2->ResumeLayout(false);
        this->toolStrip2->PerformLayout();
        this->toolStrip1->ResumeLayout(false);
        this->toolStrip1->PerformLayout();
        this->RegionTabs->ResumeLayout(false);
        this->statusStrip1->ResumeLayout(false);
        this->statusStrip1->PerformLayout();
        this->mapContainer1->ResumeLayout(false);
        this->mapContainer1->PerformLayout();
        (static_cast<System::ComponentModel::ISupportInitialize*>(this->MapImage))->EndInit();
        this->ResumeLayout(false);
        this->PerformLayout();

        delete resources;
    }
}
